/*
@data: 2023/7/10
@author: North
@desc: test
*/
package main

import "fmt"

func main()  {
	//设置数据
	var matrix1 = [3][3]int{{1,1,1},{2,2,2},{3,3,3}}
	var matrix2 = [3][3]int{{1,1,1},{2,2,2},{3,3,3}}
	var matrix3 = [3][3]int{}
	//对matrix1进行遍历（i代表行）
	for i := range matrix1{
		//对matrix1的i行进行遍历
		for j := range matrix1[i] {
			//将两个矩阵的数字相加给matrix3
			matrix3[i][j]=matrix1[i][j]+matrix2[i][j]
		}
	}
	fmt.Println(matrix3)
}
